In this lab you will implement a General Purpose Processor (GPP) using techniques we've learned so far. A GPP unlike a Single Purpose Processor can accomplish various tasks via programs written in an Instruction Set that the microprocessor can recognize. Most processors are built from a controller, dataptath and memory. For the purposes of this lab we will deviate from this processor architecture and have the memory integrated into the controller.
A few things to note:
The General Purpose Processor we will be building will have to recognize the instruction set found below:
| INSTRUCTION | OPCODE | FUNCTION |
| MOVA Rd | 0000|dd00 | Accumulator = Register [dd] |
| MOVR Rd | 0001|dd00 | Register [dd] = Accumulator |
| LOAD Mem * | 0010|mmmm | Accumulator = Memory[mmmm] |
| LOADI Imm | 0011|iiii | Accumulator = Immediate |
| STORE Mem *,# | 0100|mmmm | Memory[mmmm] = Accumulator |
| JZ Address | 0101|0000 aaaa|aaaa |
if (Acc == 0) PC = Address[aaaa] // goto address else NOP // do nothing |
| JMP Address | 0110|0000 aaaa|aaaa |
PC = Address[aaaa] |
| ADD Rd | 0111|dd00 | Accumulator = Accumulator + Register[dd] |
| ANDR Rd | 1001|dd00 | Accumulator = Accumulator AND Register[dd] |
| INV | 1011|0000 | Accumulator = NOT Accumulator |
| SHR | 1010|0000 | Accumulator = Accumulator >> 1 |
| SUB Rd # | 1000|dd00 | Accumulator = Accumulator - Register[dd] |
| HALT | 1111|1111 | Stop execution |
The following files contain VHDL code for a microprocessor that only operates
on 2 instructions: LOADI and HALT.
When you download these you will need
to rename them so the extensions are .vhd.
Assignment
*Note: The
output should come from the Accumulator inside your datapath. This is because
all the data movement/alu operations involve the Accumulator. By tieing the
output to this at all times, we can see what is going on. Currently, the
skeleton has the output of the alu, going straight to the output of the whole
thing. You should change this.
The code for the Accumulator and
Register File is included. You can write your own if you want but in either
case you still need to figure out how to interconnect all these components.
Yes, this is possible by implementing one funtion/instruction at a time. Do
this by connecting only what you need per component. For instance, only use
one register inside the register file...this way you can bypass the use of a
select line at first. Understand? Don't connect everything given to you hoping
it will work. We've purposely left out the needed interconnections in all 3
files so you can "GROW" your design.